﻿<!doctype html>
<html>
<head>
<#include "/part_meta.ftl">
<title>商品列表-迈小众</title>
<link href="${st.resDomain}/css/style.css" rel="stylesheet">
<link href="${st.resDomain}/css/form-base.css" rel="stylesheet">
<link href="${st.resDomain}/css/MC-base.css" rel="stylesheet">
<link href="${st.resDomain}/css/MC.css" rel="stylesheet">
</head>

<body>
<!--- header --->
<div id="header">
  <div class="main f_clear">
  	<div class="logo"><h2><@shiro.principal property="c_name"/></h2><span>您好！<@shiro.principal property="m_name" />， <a href="${st.domain}/member/logoutDo">退出</a></span></div>
    <div class="f_right"><a href="${st.userDomain}">个人中心</a> <@shiro.hasRole name="SHOP"><a href="${st.shopDomain}">店铺管理</a></@shiro.hasRole><a href="${st.firmDomain}" class="selected">企业管理</a></div>
  </div>
</div>
<!--- header end--->
<!--topnav -->
<div id="topnav">
  <div class="main">
    <ul class="left">
      
      <li class="selected"><a href="${st.firmDomain}/goods/list">商品</a></li>
      <li><a href="${st.firmDomain}/store/list">店铺</a></li>
      <li><a href="${st.firmDomain}/memberVip/list">会员</a></li>
      <li><a href="${st.firmDomain}/company/edit">企业</a></li>
      <li><a href="${st.firmDomain}/goodsReport">数据</a></li>
    </ul>
  </div>
</div>
<!--topnav end-->
<div id="main" class="f_clear">
  <div id="left">
  	<ul id="menu1">
      <li class="selected"><a href="${st.firmDomain}/goods/list">商品库</a></li>
	  <li><a href="${st.firmDomain}/goodsClassify/list">商品类目</a></li>
    </ul>
  </div>
  <div id="right">
    <div id="title">商品库 - 商品列表</div>
    <div id="search">
      <div id="hideData" style="display:none">${goods.company.companyId}</div>
      <form id="search_form" onsubmit="$(this).showMsg('正在查询...', 'load');">
      <div class="left">
        <span id="selectClassify"></span>
        <input type="hidden" id="classifyId" name="goodsClassify.classifyId" value="${goods.goodsClassify.classifyId}" >
        <input type="text" name="searchWord" value="${searchWord}" placeholder="商品名/商品编码" autofocus="autofocus" class="k"/>
        <input type="submit" class="feignhide"><!-- 实现回车提交 -->
      	<a onclick="$('#search_form').submit();" class="btn3">查询</a>
      </div>
      </form>
      <div class="right"><a href="${st.firmDomain}/goods/addOrEdit" class="btn2">添加商品</a></div>
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab" id="spgl">
      <tr>
        <th class="w1"><input name="input" type="checkbox" value="" /></th>
        <th class="w2">商品名称</th>
        <th class="w3">&nbsp;</th>
        <th>商品类目</th>
        <th colspan="2">价格(￥)</th>
        <th>出售单位</th>
      </tr>
      <#list list as g>
      <tr>
        <td class="w1"><input name="goodsIds" type="checkbox" value="${g.goodsId}" /></td>
        <td class="w2"><a href="${st.firmDomain}/goods/addOrEdit?barCode=${g.barCode}"><img src="${st.resDomain}/images/goods_def.jpg" <#if g.pic??>data="${g.pic}" </#if> /></a></td>
        <td class="w3"><span>${g.barCode}</span><br><a href="${st.firmDomain}/goods/addOrEdit?barCode=${g.barCode}">${g.name}</a></td>
        <td>${g.goodsClassify.name}</td>
        <td class="price"><span class="w6">${g.price}</span></td>
        <td class="unit">/${g.unit}</td>
        <td>${g.sellUnit}</td>
      </tr>
      </#list>
    </table>
    <div class="tabletj">
      <div id="page">
        ${pl.linkString}
      </div>
    </div>
  </div>
</div>
<!--footer-->
<div id="footer">Copyright© 迈小众 <span style="padding-left:30px;">客服QQ：<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=3101084438&site=qq&menu=yes" rel="nofollow"><img border="0" src="http://wpa.qq.com/pa?p=2:3101084438:50" alt="点击联系我们，QQ：3101084438" title="点击联系我们，QQ：3101084438"></a></span></div>
<!--footer end-->
<script src="${st.resDomain}/scripts/require.js"></script>
<script>
require(["${st.resDomain}/scripts/common.js"], function() {
	loadjs(["pagectrl"]);
	$("#classifyId_" + $("#classifyId").val()).css({color: "#EA0000"});
	$("#fl a[id^='classifyId_']").click(function() {
		$("#classifyId").val(($(this).attr("id").split("_"))[1]);
		$("#search_form").submit();
	})
	
	loadjs(["goodsClassify"], function() {
		$("#selectClassify").goodsClassifyComboBox({
			value: $("#classifyId").val(),
			companyId: $("#hideData").html(),
			onSelect: function(deep, classify) {
				// 获取选中的最后一个有效值
				var value = $("#selectClassify select option:selected[value!='']:last").val();
				$("#classifyId").val(value);
			}
		});
	});
});

</script>
</body>
</html>
